package com.zmn.oms.persistence.interfaces.visit;

import com.zmn.oms.model.entity.visit.OrderVisit;
import com.zmn.oms.model.entity.visit.OrderVisitQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 类描述：上门/多次上门
 *
 * @author yule
 * @date 2021/3/10 18:59
 */
public interface OrderVisitDao {

    /**
     * 按查询条件查询
     *
     * @param orderVisitQuery
     * @return
     */
    OrderVisit findOrderVisitByQuery(OrderVisitQuery orderVisitQuery);

    /**
     * 按工单id 查询
     *
     * @param orderId
     * @return
     */
    List<OrderVisit> listByOrderId(@Param("orderId") Long orderId);

    /**
     * 按工单id 查询
     *
     * @param orderIdList
     * @return
     */
    List<OrderVisit> listOrderVisitByOrderIdList(@Param("orderIdList") List<Long> orderIdList);

    /**
     * 按工单id 查询
     *
     * @param orderId
     * @return
     */
    List<OrderVisit> listByOrderIdAndMasterId(@Param("orderId") Long orderId, @Param("masterId") Integer masterId);

    /**
     * 新增
     *
     * @param orderVisit
     * @return
     */
    int insert(OrderVisit orderVisit);

    /**
     * 修改
     *
     * @param
     */
    int updateByKey(OrderVisit orderVisit);

    /**
     * 更新支付状态
     * @param orderVisit
     * @return
     */
    int updatePayStatusByKey(OrderVisit orderVisit);
}
